package lq2081;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long m = sc.nextLong();
		long x = sc.nextLong();
		long[] a = new long[(int)n+1];//下标从1开始
		for(int i=1;i<=n;i++) {
			a[i] = sc.nextLong();
		}
		
		//m次查询
		for(int i=1;i<=m;i++) {
			long l = sc.nextLong();
			long r = sc.nextLong();
		
			//是否找到
			boolean flag = false;
			
			//暴力枚举区间组合
			for(int j=(int)l;j<=r-1;j++) {
				for(int k=j+1;k<=r;k++) {
					//System.out.printf("[%d,%d],", j,k);
					if(x == (a[j]^a[k])) {
						System.out.println("yes");
						flag = true;
						break;
					}
				}
				if(flag)
					break;
			}
			
			if(!flag)
				System.out.println("no");
		}
	}
}
